package jtk.project4.fleet;


import javax.swing.SortOrder;

import jtk.project4.fleet.action.AddAccidentEntryAction;
import jtk.project4.fleet.action.AddBrowsePaymentAction;
import jtk.project4.fleet.action.AddCustomerAction;
import jtk.project4.fleet.action.AddEditFuelEntryAction;
import jtk.project4.fleet.action.AddEditPurchaseOrderAction;

import jtk.project4.fleet.action.AddAttachmentAction;
import jtk.project4.fleet.action.AddEmployeeAction;
import jtk.project4.fleet.action.AddEquipmentAction;
import jtk.project4.fleet.action.AddFluidConsumedAction;
import jtk.project4.fleet.action.AddGeneralExpenseAction;
import jtk.project4.fleet.action.AddInventoryAction;
import jtk.project4.fleet.action.AddInvoiceAction;
import jtk.project4.fleet.action.AddLaborAction;
import jtk.project4.fleet.action.AddMaintenanceTaskAction;
import jtk.project4.fleet.action.AddMeterUpdateAction;
import jtk.project4.fleet.action.AddNewCategoryAction;
import jtk.project4.fleet.action.AddNewFuelTankAction;
import jtk.project4.fleet.action.AddNewLocationAction;
import jtk.project4.fleet.action.AddPartInventoryAction;
import jtk.project4.fleet.action.AddPartUsedAction;
import jtk.project4.fleet.action.AddPaymentAction;
import jtk.project4.fleet.action.AddScheduleRepairAction;
import jtk.project4.fleet.action.AddTireAssigmentAction;
import jtk.project4.fleet.action.EditCompanyNameAction;
import jtk.project4.fleet.action.EditTireHistoryAction;
import jtk.project4.fleet.action.AddUpdateMeterAction;
import jtk.project4.fleet.action.AddVendorAction;
import jtk.project4.fleet.action.AdjustInventoryForPartAction;
import jtk.project4.fleet.action.AdvancedOptionsAction;
import jtk.project4.fleet.action.AutoGeneratePOAction;
import jtk.project4.fleet.action.BrowsePurchaseOrdersAction;
import jtk.project4.fleet.action.CostStatisticAction;
import jtk.project4.fleet.action.CustomerManagementAction;
import jtk.project4.fleet.action.EditMaintenanceTaskAction;
import jtk.project4.fleet.action.GeneralTankInformationAction;
import jtk.project4.fleet.action.LastPmSetUpAction;
import jtk.project4.fleet.action.LocationCategoryConfigurationAction;
import jtk.project4.fleet.action.MeterReplacementsAction;
import jtk.project4.fleet.action.NewEmailNotificationAction;
import jtk.project4.fleet.action.PMScheduleSetupAction;
import jtk.project4.fleet.action.POSelectionAction;
import jtk.project4.fleet.action.PoReceiptByInventoriedPartAction;
import jtk.project4.fleet.action.PurchaseOrderAction;
import jtk.project4.fleet.action.TireHistoryAction;
import jtk.project4.fleet.action.TripInformationEquipmentAction;
import jtk.project4.fleet.action.ViewEmployeeAction;
import jtk.project4.fleet.action.ViewMaintenanceHistoryAction;
import jtk.project4.fleet.action.ViewPMandRepairMaintenanceDueAction;
import jtk.project4.fleet.action.ViewScheduleRepairAction;
import jtk.project4.fleet.action.ViewTireInventoryAction;
import jtk.project4.fleet.action.UpdateMeterLogAction;
import jtk.project4.fleet.action.ViewVendorAction;
import jtk.project4.fleet.action.WorkOrderManagementAction;
import jtk.project4.fleet.screen.workOrderManagement.WorkOrderManagementView;

import nl.coderight.jazz.action.Action;
import nl.coderight.jazz.form.FormView;
import nl.coderight.jazz.form.control.GroupControl;
import nl.coderight.jazz.form.field.TableField;
import nl.coderight.jazz.form.field.TableField.AutoResizeMode;
import nl.coderight.jazz.view.Menu;
import nl.coderight.jazz.view.MenuBar;
import nl.coderight.jazz.view.MenuItem;

public class FleetView extends FormView{
	private Action addPaymentAction;
	private Action addEquipmentAction;
	private Action addEmployeeAction;
	private Action viewWorkOrderManagementAction ;
	private Action viewUpdateMeterLogAction ;
	private Action viewTireInventoryAction ;
	private Action addTireHistoryAction ;
	private Action addInventoryAction ;
	private Action purchaseOrderAction ;
	private Action viewCostStatisticPartUsedAction ;
	private Action viewPMandRepairMaintenanceDueEventAction ;
	private Action viewMaintenanceHistory ;
	private Action addUpdateMeterAction;
	private Action addMeterUpdateAction;
	private Action coststatisticAction;
	private Action adjustInventoryAction ; 
	private Action addScheduleRepairAction ;
	private Action addLaborAction ;	
	private Action addMeterReplacementsAction;
	private Action editScheduleRepairAction;
	private Action addEmailNotificationAction;
	private Action addFluidConsumedAction;
	private Action addFuelEntryAction;
	private Action addExpenseAction;
	private Action tripInformationEquipmentAction;
	private Action customerManagement;	
	private Action addPartUsedAction ;
	private Action poReceiptByInventoriedPartAction ;	
	private Action addPartInventoryAction;
	private Action lastPmSetUpAction;
	private Action generalTankInformationAction;	
	private Action addMaintenanceTaskAction;
	private Action editMaintenanceTaskAction;	
	private Action addNewFuelTankAction;	
	private Action viewScheduleRepairAction;	
	private Action addVendorAction;	
	private Action advancedOptionsAction;	
	private Action addBrowsePaymentAction;
	private Action browsePurchaseOrdersAction;	
	private Action addCustomerAction;
	private Action addAccidentEntryAction;	
	private Action addEditPurchaseOrderAction;	
	private TableField equipmentTable;	
	private Action autoGeneratePo;	
	private Action poSelection;	
	private Action invoices;	
	private Action tireHistoryAction;
	private Action customerDatabaseAction;
	private Action addNewLocationAction;
	private Action addNewCategoryAction;
	private Action editCompanyNameAction;
	private Action locationCategoryConfigurationAction;
	private Action tireAssigment;
	private Action viewVendorAction;
	private Action ViewEmployeeAction;
	private Action pmScheduleSetupAction;
	private Action addAttachmentAction;
	
	private void createActions(){
		addPaymentAction = new AddPaymentAction();
		addEquipmentAction = new AddEquipmentAction();
		addEmployeeAction = new AddEmployeeAction();
		viewWorkOrderManagementAction = new WorkOrderManagementAction();
		viewUpdateMeterLogAction = new UpdateMeterLogAction() ;
		viewTireInventoryAction = new ViewTireInventoryAction() ;
		addTireHistoryAction = new EditTireHistoryAction();
		addInventoryAction = new AddInventoryAction() ;
		purchaseOrderAction = new PurchaseOrderAction() ;
		viewCostStatisticPartUsedAction = new  CostStatisticAction();
		viewPMandRepairMaintenanceDueEventAction = new ViewPMandRepairMaintenanceDueAction();
		viewMaintenanceHistory = new ViewMaintenanceHistoryAction();
		addUpdateMeterAction = new AddUpdateMeterAction();
		addMeterUpdateAction = new AddMeterUpdateAction();
		adjustInventoryAction = new AdjustInventoryForPartAction();
		addScheduleRepairAction = new AddScheduleRepairAction();
		addPartInventoryAction = new AddPartInventoryAction();
		addLaborAction = new AddLaborAction();
		
		addMeterReplacementsAction = new MeterReplacementsAction();
		addEmailNotificationAction = new NewEmailNotificationAction();
		addFluidConsumedAction = new AddFluidConsumedAction();
		addFuelEntryAction = new AddEditFuelEntryAction();
		addExpenseAction = new AddGeneralExpenseAction();
		tripInformationEquipmentAction = new TripInformationEquipmentAction();
		customerManagement = new CustomerManagementAction();

		lastPmSetUpAction = new LastPmSetUpAction();
		addInventoryAction = new AddInventoryAction();
		generalTankInformationAction =  new GeneralTankInformationAction();
		
		addPartUsedAction = new AddPartUsedAction();
		poReceiptByInventoriedPartAction = new PoReceiptByInventoriedPartAction();

		addMaintenanceTaskAction = new AddMaintenanceTaskAction();
		editMaintenanceTaskAction = new EditMaintenanceTaskAction();
		
		addNewFuelTankAction = new AddNewFuelTankAction();
		//generalTankInformationAction = new GeneralTankInformationAction();
		
		viewScheduleRepairAction = new ViewScheduleRepairAction();
	
		addVendorAction = new AddVendorAction();
		
		advancedOptionsAction = new AdvancedOptionsAction();
		
		addBrowsePaymentAction = new AddBrowsePaymentAction();
		
		browsePurchaseOrdersAction = new BrowsePurchaseOrdersAction();
		
		addCustomerAction = new AddCustomerAction();
		
		//lastPmSetUpAction = new LastPmSetUpAction();
		
		addAccidentEntryAction = new AddAccidentEntryAction();
		
		addEditPurchaseOrderAction = new AddEditPurchaseOrderAction();
		
		autoGeneratePo = new AutoGeneratePOAction();
		
		poSelection = new POSelectionAction();
		
		invoices = new AddInvoiceAction();
		
		tireHistoryAction = new TireHistoryAction();
		
		addNewLocationAction = new AddNewLocationAction();
		addNewCategoryAction = new AddNewCategoryAction();
		editCompanyNameAction = new EditCompanyNameAction();
		locationCategoryConfigurationAction = new LocationCategoryConfigurationAction();
		tireAssigment = new AddTireAssigmentAction();
		
		viewVendorAction = new ViewVendorAction();
		pmScheduleSetupAction = new PMScheduleSetupAction();
		addAttachmentAction = new AddAttachmentAction();
		ViewEmployeeAction = new ViewEmployeeAction();
		
	}
	
	public FleetView(){
		setTitle("JTK Fleet");
		setSize(800, 600);
		center();
	}

	@Override
	protected void init() {
		// TODO Auto-generated method stub
		createActions();
		createFields();
		createLayout();
		
		setMenuBar(createMenuBar());
		
	}
	

	private MenuBar createMenuBar(){
		Menu fileMenu = new Menu("menu.file");
		fileMenu.addMenuItem(new MenuItem(addEquipmentAction)); 
		fileMenu.addMenuItem(new MenuItem("Add Duplicate"));
		fileMenu.addMenuItem(new MenuItem("Edit"));
		fileMenu.addMenuItem(new MenuItem("Delete"));
		
		Menu setupMenu = new Menu("menu.setup");
		setupMenu.addMenuItem(new MenuItem("Locations/Categories"));
		setupMenu.addMenuItem(new MenuItem(pmScheduleSetupAction));
		setupMenu.addMenuItem(new MenuItem("PM Associations"));
		setupMenu.addMenuItem(new MenuItem("Employee Database"));
		setupMenu.addMenuItem(new MenuItem(customerManagement));
		setupMenu.addMenuItem(new MenuItem(viewVendorAction));
		
		Menu choiceListMenu = new Menu("menu.choicelist");
		choiceListMenu.addMenuItem(new MenuItem ("Accident Types..."));
		choiceListMenu.addMenuItem(new MenuItem ("Cost Center..."));
		
		Menu employeesMenu = new Menu("menu.employees");
		employeesMenu.addMenuItem(new MenuItem ("Categories..."));
		employeesMenu.addMenuItem(new MenuItem ("Certifications..."));
		employeesMenu.addMenuItem(new MenuItem ("Status..."));
		employeesMenu.addMenuItem(new MenuItem ("Types..."));
		employeesMenu.addMenuItem(new MenuItem ("E-Mail Addresses..."));
		
		choiceListMenu.addMenu(employeesMenu);
		
		Menu equipmentSubMenu = new Menu("menu.equipment");
		equipmentSubMenu.addMenuItem(new MenuItem ("Expirations..."));
		equipmentSubMenu.addMenuItem(new MenuItem ("Makes..."));
		equipmentSubMenu.addMenuItem(new MenuItem ("Models..."));
		equipmentSubMenu.addMenuItem(new MenuItem ("Types..."));
		equipmentSubMenu.addMenuItem(new MenuItem ("Colors..."));
		equipmentSubMenu.addMenuItem(new MenuItem ("Status..."));
		equipmentSubMenu.addMenuItem(new MenuItem ("Transmission Types..."));
	
		choiceListMenu.addMenu(equipmentSubMenu);
		
		Menu fluidsMenu = new Menu("menu.fluids");
		fluidsMenu.addMenuItem(new MenuItem ("Fluids Types..."));
		fluidsMenu.addMenuItem(new MenuItem ("Units Types..."));
		
		choiceListMenu.addMenu(fluidsMenu);
		
		Menu fuelMenu = new Menu("menu.fuel");
		fuelMenu.addMenuItem(new MenuItem ("Fuel Type..."));
		fuelMenu.addMenuItem(new MenuItem ("Fuel Brand..."));
		fuelMenu.addMenuItem(new MenuItem ("State/Provence..."));
		
		choiceListMenu.addMenu(fuelMenu);
		choiceListMenu.addMenuItem(new MenuItem ("General Expense Types..."));
		
		Menu maintenanceMenu = new Menu("menu.maintenance");
		maintenanceMenu.addMenuItem(new MenuItem ("Common Repairs List..."));
		maintenanceMenu.addMenuItem(new MenuItem ("Maintenance Types..."));
		maintenanceMenu.addMenuItem(new MenuItem ("Repair Types..."));
		
		choiceListMenu.addMenu(maintenanceMenu);
		
		Menu partsMenu = new Menu("menu.parts");
		partsMenu.addMenuItem(new MenuItem ("Parts Categories..."));
		partsMenu.addMenuItem(new MenuItem ("Parts Manufacturers..."));
		partsMenu.addMenuItem(new MenuItem ("Units Type..."));
		
		choiceListMenu.addMenu(partsMenu);
		choiceListMenu.addMenuItem(new MenuItem ("Payment Terms..."));
		choiceListMenu.addMenuItem(new MenuItem ("Ship to Addresses..."));
		choiceListMenu.addMenuItem(new MenuItem ("Shipping Methods..."));
		
		Menu tiresMenu = new Menu("menu.tires");
		tiresMenu.addMenuItem(new MenuItem ("Payment Terms..."));
		tiresMenu.addMenuItem(new MenuItem ("Makes..."));
		tiresMenu.addMenuItem(new MenuItem ("Models..."));
		tiresMenu.addMenuItem(new MenuItem ("Services..."));
		tiresMenu.addMenuItem(new MenuItem ("Status..."));
		tiresMenu.addMenuItem(new MenuItem ("Tire Size..."));
		tiresMenu.addMenuItem(new MenuItem ("Types..."));
		
		choiceListMenu.addMenu(tiresMenu);
		
		choiceListMenu.addMenuItem(new MenuItem ("Vendor Type..."));
		
		Menu workOrdersMenu = new Menu("menu.workorder");
		workOrdersMenu.addMenuItem(new MenuItem ("Work Order Status..."));
		workOrdersMenu.addMenuItem(new MenuItem ("Work Type..."));
		
		
		choiceListMenu.addMenu(workOrdersMenu);		
		
		setupMenu.addMenu(choiceListMenu);
		
		Menu historiesMenu = new Menu ("Histories");
		historiesMenu.addMenuItem(new MenuItem(viewMaintenanceHistory));
		historiesMenu.addMenuItem(new MenuItem("Fuel History..."));
		historiesMenu.addMenuItem(new MenuItem("General Expense History History..."));
		historiesMenu.addMenuItem(new MenuItem("Fluid Consumption History..."));
		historiesMenu.addMenuItem(new MenuItem("Tire Inventory History..."));
		historiesMenu.addMenuItem(new MenuItem("Trip History..."));
		historiesMenu.addMenuItem(new MenuItem(tireHistoryAction));
		historiesMenu.addMenuItem(new MenuItem("Accident History..."));
				
		Menu equipmentMenu = new Menu("menu.equipment");
		equipmentMenu.addMenuItem(new MenuItem("Issue WO"));
		equipmentMenu.addMenuItem(new MenuItem(viewScheduleRepairAction));
		equipmentMenu.addMenuItem(new MenuItem(addFuelEntryAction));
		equipmentMenu.addMenuItem(new MenuItem(viewPMandRepairMaintenanceDueEventAction));
		equipmentMenu.addMenuItem(new MenuItem("Current Maintenance Status"));
		equipmentMenu.addMenu(historiesMenu);
		equipmentMenu.addMenuItem(new MenuItem(tireAssigment));
		equipmentMenu.addMenuItem(new MenuItem(lastPmSetUpAction));
		equipmentMenu.addMenuItem(new MenuItem(addMeterReplacementsAction));
		
		
		Menu generateWorkOrdersMenu = new Menu("Generate Work orders");
		generateWorkOrdersMenu.addMenuItem(new MenuItem("Selected Equipment..."));
		generateWorkOrdersMenu.addMenuItem(new MenuItem("Selected Category..."));
		generateWorkOrdersMenu.addMenuItem(new MenuItem("Selected Location..."));
		generateWorkOrdersMenu.addMenuItem(new MenuItem("All Equipment..."));
		
		Menu pmCheckWizardMenu = new Menu("PM Check Wizard");
		pmCheckWizardMenu.addMenuItem(new MenuItem("Selected Equipment..."));
		pmCheckWizardMenu.addMenuItem(new MenuItem("Selected Category..."));
		pmCheckWizardMenu.addMenuItem(new MenuItem("Selected Location..."));
		pmCheckWizardMenu.addMenuItem(new MenuItem("All Equipment..."));
		
		Menu fleetMenu = new Menu("menu.fleet");
		fleetMenu.addMenu(generateWorkOrdersMenu);
		fleetMenu.addMenu(pmCheckWizardMenu);
		fleetMenu.addMenuItem(new MenuItem(viewWorkOrderManagementAction));
		fleetMenu.addMenuItem(new MenuItem("Schedule Repair Management"));
		fleetMenu.addMenuItem(new MenuItem(addUpdateMeterAction));
		fleetMenu.addMenuItem(new MenuItem(viewUpdateMeterLogAction));
		fleetMenu.addMenuItem(new MenuItem(viewCostStatisticPartUsedAction));
		fleetMenu.addMenuItem(new MenuItem("Graphing"));
		fleetMenu.addMenuItem(new MenuItem("Email Log"));
		
		Menu inventoryMenu = new Menu("menu.inventory");
		inventoryMenu.addMenuItem(new MenuItem(addInventoryAction));
		inventoryMenu.addMenuItem(new MenuItem(viewTireInventoryAction));
		inventoryMenu.addMenuItem(new MenuItem(generalTankInformationAction));
		inventoryMenu.addMenuItem(new MenuItem(browsePurchaseOrdersAction));
		inventoryMenu.addMenuItem(new MenuItem(purchaseOrderAction));
		inventoryMenu.addMenuItem(new MenuItem(poReceiptByInventoriedPartAction));
		inventoryMenu.addMenuItem(new MenuItem(adjustInventoryAction));
		inventoryMenu.addMenuItem(new MenuItem(autoGeneratePo));
		
		Menu billingMenu = new Menu("menu.billing");
		billingMenu.addMenuItem(new MenuItem(invoices));
		billingMenu.addMenuItem(new MenuItem("Browse Invoices"));
		billingMenu.addMenuItem(new MenuItem(addPaymentAction));
		billingMenu.addMenuItem(new MenuItem(addBrowsePaymentAction));
		
		
		Menu toolsMenu = new Menu("menu.tools");
		
		Menu reportMenu = new Menu("menu.report");
		
		Menu windowMenu = new Menu("menu.window");
		
		Menu securityMenu = new Menu("menu.security");
		
		Menu helpMenu = new Menu("menu.help");
		
		Menu testMenu = new Menu("TEST");
		testMenu.addMenuItem(new MenuItem(addEmployeeAction));
		testMenu.addMenuItem(new MenuItem(ViewEmployeeAction));
		//testMenu.addMenuItem(new MenuItem(addScheduleRepairAction));
		//testMenu.addMenuItem(new MenuItem(addPartInventoryAction));
		testMenu.addMenuItem(new MenuItem(addLaborAction));
		//testMenu.addMenuItem(new MenuItem(editScheduleRepairAction));
		testMenu.addMenuItem(new MenuItem(addEmailNotificationAction));
		testMenu.addMenuItem(new MenuItem(addFluidConsumedAction));
		testMenu.addMenuItem(new MenuItem(addExpenseAction));
		testMenu.addMenuItem(new MenuItem(tripInformationEquipmentAction));
		//testMenu.addMenuItem(new MenuItem(customerManagement));
		//testMenu.addMenuItem(new MenuItem(addScheduleRepairAction));
		testMenu.addMenuItem(new MenuItem(addPartUsedAction));
		
		testMenu.addSeparator();
		testMenu.addMenuItem(new MenuItem(addMaintenanceTaskAction));//dipanggil di dalam
		testMenu.addMenuItem(new MenuItem(editMaintenanceTaskAction));//dipanggil di dalam
		testMenu.addSeparator();
		//testMenu.addMenuItem(new MenuItem(addNewFuelTankAction));//dipanggil di dalam
		//testMenu.addMenuItem(new MenuItem(generalTankInformationAction));//dipanggil di dalam
		testMenu.addSeparator();
		//testMenu.addMenuItem(new MenuItem(viewScheduleRepairAction));
		//testMenu.addSeparator();
		testMenu.addMenuItem(new MenuItem(addVendorAction));		
		testMenu.addSeparator();
		testMenu.addMenuItem(new MenuItem(advancedOptionsAction));
		testMenu.addSeparator();
		//testMenu.addMenuItem(new MenuItem(addBrowsePaymentAction));
		//testMenu.addSeparator();
		//testMenu.addMenuItem(new MenuItem(browsePurchaseOrdersAction));
		//testMenu.addSeparator();
		//testMenu.addMenuItem(new MenuItem(addCustomerAction));
		//testMenu.addSeparator();
		//testMenu.addMenuItem(new MenuItem(lastPmSetUpAction));
		//testMenu.addSeparator();
		testMenu.addMenuItem(new MenuItem(addAccidentEntryAction));
		testMenu.addSeparator();
		//testMenu.addMenuItem(new MenuItem(addEditPurchaseOrderAction));
		//testMenu.addSeparator();
		//testMenu.addMenuItem(new MenuItem(poSelection));
		//testMenu.addMenuItem(new MenuItem(invoices));
		testMenu.addMenuItem(new MenuItem(locationCategoryConfigurationAction));
		testMenu.addMenuItem(new MenuItem(addNewLocationAction));
		testMenu.addMenuItem(new MenuItem(addNewCategoryAction));
		testMenu.addMenuItem(new MenuItem(editCompanyNameAction));
		testMenu.addMenuItem(new MenuItem(new AddAttachmentAction()));

		
		//Menu Bar	
		MenuBar menuBar = new MenuBar(this);
		menuBar.addMenu(fileMenu);
		menuBar.addMenu(setupMenu);
		menuBar.addMenu(equipmentMenu);
		menuBar.addMenu(fleetMenu);
		menuBar.addMenu(inventoryMenu);
		menuBar.addMenu(billingMenu);
	//	menuBar.addMenu(toolsMenu);
	//	menuBar.addMenu(reportMenu);
	//	menuBar.addMenu(windowMenu);
	//	menuBar.addMenu(securityMenu);
	//	menuBar.addMenu(helpMenu);
		menuBar.addMenu(testMenu);
		return menuBar;
	}

	private void createFields(){
		//setup table
		equipmentTable = new TableField("equipments","equipment");
		equipmentTable.setTitle("equipment.header.table");
		equipmentTable.setAutoResizeMode(AutoResizeMode.OFF);
		equipmentTable.getSelectionValues();
		
		//add columns
		equipmentTable.addColumn("label.unit","unit");
		equipmentTable.addColumn("label.year","year");
		equipmentTable.addColumn("label.make","make");
		equipmentTable.addColumn("label.model","model");
		equipmentTable.addColumn("label.plate","plate");
		equipmentTable.addColumn("label.meter1","meter1");
		equipmentTable.addColumn("label.meter2","meter2");
		equipmentTable.addColumn("label.vin","vin");
		equipmentTable.addColumn("label.type","type");
		equipmentTable.addColumn("label.color","color");
		equipmentTable.addColumn("label.driver","driver");
		equipmentTable.addColumn("label.status","status");
		equipmentTable.addColumn("label.identification","identification");
		equipmentTable.addColumn("label.schedule","schedule");
		equipmentTable.addColumn("label.tripStatus","tripStatus");
		equipmentTable.addColumn("label.baseUnit1","baseUnit1");
		equipmentTable.addColumn("label.baseUnit2","baseUnit2");
		equipmentTable.addColumn("label.baseDate","baseDate");
		equipmentTable.addColumn("label.weight","weight");
		equipmentTable.addColumn("label.length","length");
		equipmentTable.addColumn("label.width","width");
		equipmentTable.addColumn("label.height","height");
		equipmentTable.addColumn("label.wheelBase","wheelBase");
		equipmentTable.addColumn("label.axles","axles");
		equipmentTable.addColumn("label.tireSizeF","tireSizeF");
		equipmentTable.addColumn("label.tireSizeR","tireSizeR");
		equipmentTable.addColumn("label.tirePressureF","tirePressureF");
		equipmentTable.addColumn("label.tirePressureR","tirePressureR");
		equipmentTable.addColumn("label.tireEngineSize","tireEngineSize");
		equipmentTable.addColumn("label.transmissionType","transmissionType");
		equipmentTable.addColumn("label.fuelType","fuelType");
		equipmentTable.addColumn("label.engine","engine");
		equipmentTable.addColumn("label.trans","trans");
		equipmentTable.addColumn("label.fTires","fTires");
		equipmentTable.addColumn("label.rTires","rTires");
		equipmentTable.addColumn("label.airFilter","airFilter");
		equipmentTable.addColumn("label.fuelFilter","fuelFilter");
		equipmentTable.addColumn("label.transFilter","transFilter");
		equipmentTable.addColumn("label.custVal9","custVal9");
		equipmentTable.addColumn("label.custVal10","custVal10");
		equipmentTable.addColumn("label.custVal11","custVal11");
		equipmentTable.addColumn("label.custVal12","custVal12");
		equipmentTable.addColumn("label.custVal13","custVal13");
		equipmentTable.addColumn("label.custVal14","custVal14");
		equipmentTable.addColumn("label.purchDate","purchDate");
		equipmentTable.addColumn("label.purchaseMeter","purchaseMeter");
		equipmentTable.addColumn("label.purchPrice","purchPrice");
		equipmentTable.addColumn("label.costCenter","costCenter");
		equipmentTable.addColumn("label.owner","owner");
		equipmentTable.addColumn("label.startCost","startCost");
		equipmentTable.addColumn("label.depreciationTerm","depreciationTerm");
		equipmentTable.addColumn("label.salvage","salvage");
		equipmentTable.addColumn("label.salvageValue","salvageValue");
		equipmentTable.addColumn("label.licenceType","licenceType");
		equipmentTable.addColumn("label.licenseState","licenseState");
		equipmentTable.addColumn("label.virtualMeter1","virtualMeter1");
		equipmentTable.addColumn("label.virtualMeter2","virtualMeter2");
		equipmentTable.addColumn("label.ownership","ownership");
		equipmentTable.addColumn("label.warrantyDate","warrantyDate");
		equipmentTable.addColumn("label.warrantyMeter","warrantyMeter");
		equipmentTable.addColumn("label.location","location");
		equipmentTable.addColumn("label.category","category");
		
		
		
		//Sort
		equipmentTable.sort("unit", SortOrder.ASCENDING);
	}
	
	private void createLayout(){
		addField(createFieldGroup(), CENTER);
	}
	
	private GroupControl createFieldGroup(){
		GroupControl fieldGroup=new GroupControl();
		fieldGroup.addField(equipmentTable, CENTER);
		return fieldGroup;
	}
}
